// stores/counter.js
import { defineStore } from 'pinia'

export const useBigScreenStore = defineStore('useBigScreen', {
  state: () => {
    return { isLoading: false }
  },
  // 也可以这样定义
  // state: () => ({ count: 0 })
  actions: {
    showLoading() {
      this.isLoading = true
    },
    hideLoading() {
      this.isLoading = false
    },
  },
})

/** 解析年月字符串 "2025-12" 格式 */
export function parseDate(dateStr: string) {
  const [year, month] = dateStr.split('-').map(Number)

  // 计算季度
  const quarter = Math.ceil(month / 3)

  return {
    year,
    month,
    quarter,
  }
}
